package com.codeczx.imitation.taobao;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;

import com.codeczx.imitation.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HomeActivity extends AppCompatActivity {

    @BindView(R.id.tabLayout_main)
    TabLayout tabLayoutMain;

    private TabLayout.Tab one;
    private TabLayout.Tab two;
    private TabLayout.Tab three;
    private TabLayout.Tab four;
    private TabLayout.Tab five;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        ButterKnife.bind(this);

        one = tabLayoutMain.getTabAt(0);
        two = tabLayoutMain.getTabAt(1);
        three = tabLayoutMain.getTabAt(2);
        four = tabLayoutMain.getTabAt(3);
        five = tabLayoutMain.getTabAt(4);

        one.setIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_taobao));
        two.setIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_taobao));
        three.setIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_taobao));
        four.setIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_taobao));
        five.setIcon(ContextCompat.getDrawable(this, R.drawable.ic_my_taobao));

        one.setText("one");
    }
}
